import requests
import json

with open('demo.txt', 'r') as f:
    content = f.readlines()

with open('demo.txt', 'w') as f2:
    for line in content:
        url = 'http://127.0.0.1:8079/qingping/payload'
        request_data = line.strip()
        try:
            response = requests.post(url=url, data=request_data)
        except:
            f2.write(line)
        response_date = json.loads(response.content)
        if response_date.get('code') == '200':
            continue
        f2.write(line)


# print(response)